<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function a(xx) {
      this.x = xx;
      return this
    };
    var x = a(2);

    var y = a(61);
    console.log(x.x); //undefied
    console.log(y.x) //6

    var name = 22;
    var obj = {
      name: '11',
      say: function () {
        console.log(this.name);
      }
    }

    const funs = obj.say;
    funs() //22 
    obj.say() //11

    const b = {
      name: 3,
      say: function (fun) {
        fun()
      }
    }
    b.say(obj.say) //22
    b.say = obj.say;
    b.say() //3


    const names = 11
    const o = {
      names: 1,
      say: () => {
        console.log(this);
        console.log(this.names);
      },
      hellow: function () {
        console.log(this);
      }
    }
    o.say()
    o.hellow()
  </script>
</body>

</html>